spam = input()
if spam[-1] in ['C', 'c']:
    F = eval(spam[0:-1])*1.8+32
    print("{:.2f}F".format(F))
elif spam[-1] in ['F', 'f']:
        C = (eval(spam[0:-1])-32)/1.8
        print("{:.2f}C".format(C))
else:
        print("输入格式错误")